package com.ruoyi.web.group.teams.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ruoyi.web.group.teams.entity.Teams;
import com.ruoyi.web.group.teams.mapper.TeamsMapper;
import com.ruoyi.web.group.teams.service.TeamsService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeamsServiceImpl extends ServiceImpl<TeamsMapper, Teams> implements TeamsService {
    @Override
    public List<Teams> findList(Teams teams) {
        QueryWrapper<Teams> queryWrapper = new QueryWrapper<>();
        if(teams.getTeamName()!=null){
            queryWrapper.like("team_name",teams.getTeamName());
        }
        Page<Teams> teamsPage = baseMapper.selectPage(new Page<Teams>(1, 10), queryWrapper);

        return teamsPage.getRecords();
    }
}